using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Sandia.MVCFramework.Common
{
    /// <summary>
    /// A custom IComparere for FileSystemInfos. 
    /// This compares the file names.
    /// </summary>
    public class FileSystemInfoComparer : IComparer<FileSystemInfo>
    {
        #region IComparer<FileSystemInfo> Members

        /// <summary>
        /// Compares the provided FileSystemInfos.
        /// </summary>
        /// <param name="x">A FileSystemInfo to compare.</param>
        /// <param name="y">A FileSystemInfo to compare.</param>
        /// <returns>
        /// Less than 0, x is less than y. Greater than 0, x is greater than y.
        /// 0, they are equal.
        /// </returns>
        public int  Compare(
            FileSystemInfo x,
            FileSystemInfo y)
        {
 	        return String.Compare(x.Name, y.Name);
        }

        #endregion
    }
}
